//
//  HuaFeiView.m
//  GuoBang
//
//  Created by fengshuai on 16/5/3.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "HuaFeiView.h"

@implementation HuaFeiView



-(instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(11, 12, 150, 14)];
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.titleLabel.textColor = RGBCOLOR(69, 69, 69);
        [self addSubview:self.titleLabel];
        
        self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.titleLabel.frame), CGRectGetMaxY(self.titleLabel.frame) + 10, 150, 14)];
        
        self.timeLabel.font = [UIFont systemFontOfSize:14];
        self.timeLabel.textColor = RGBCOLOR(69, 69, 69);
        [self addSubview:self.timeLabel];
        
        
        self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.width - 160, CGRectGetMinY(self.titleLabel.frame), 100, 14)];
        self.moneyLabel.font = [UIFont systemFontOfSize:14];
        self.moneyLabel.textColor = RGBCOLOR(69, 69, 69);
        self.moneyLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.moneyLabel];
        
        
        
        
        self.daijinjuanLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.moneyLabel.frame), CGRectGetMinY(self.timeLabel.frame), 100, 14)];
        
        self.daijinjuanLabel.font = [UIFont systemFontOfSize:14];
        self.daijinjuanLabel.textColor = RGBCOLOR(69, 69, 69);
        self.daijinjuanLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.daijinjuanLabel];
        
    
        
        self.chongBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        self.chongBtn.frame = CGRectMake(self.frame.size.width - 60, frame.size.height / 2 - 30, 60, 60);
        
        [self.chongBtn addTarget:self action:@selector(chongAction:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:self.chongBtn];
        
        
    }
    
    return self;
    
    
    
    
}






- (id)initWithFrame:(CGRect)frame withtitle:(NSString *)title money:(NSString *)moneyStr time:(NSString *)timeStr chongzhijuan:(NSString *)chongStr btnImage:(UIImage *)image
{
    
    self = [self initWithFrame:frame];
    if (self) {
        
        self.titleLabel.text = title;
        self.moneyLabel.text = moneyStr;
        self.timeLabel.text = timeStr;
        self.daijinjuanLabel.text = chongStr;
        [self.chongBtn setImage:image forState:UIControlStateNormal];
        
        
    }
    
    return self;
    
}

- (void)chongAction:(UIButton *)sender
{
    
    
    
    
    
    
    
}


@end
